<template>
  <div class="app-service-center-sidebar-inner-power">
    <div class="app-service-center-sidebar-inner-power__title">{{ title }}</div>
    <div class="app-service-center-sidebar-inner-power__content" id="app-service-center-sidebar-inner-power-content">{{ content }}</div>
    <div class="app-service-center-sidebar-inner-power__author">{{ author }}</div>
  </div>
</template>

<script>
  // import PerfectScrollbar from 'perfect-scrollbar';
  
  export default {
    name: 'app-service-center-sidebar-inner-power',
    data() {
      return {
        timer: null,
        title: '注意事项',
        content: '授信千万条,合规第一条,审核不仔细,损失千万家',
        author: '',
        storage: null,
      };
    },
    created() {
//    this.$eventHub.$on('resize', () => {
//      this.sp.update();
//    });
//    window.setInterval(() => {
//      this.query();
//    }, 60000);
//    this.query();
    },
    destroyed() {
      window.clearInterval(this.timer);
    },
    mounted() {
//    this.$nextTick(() => {
//      this.sp = new PerfectScrollbar('#app-service-center-sidebar-inner-power-content', {
//        wheelSpeed: 0.01,
//        wheelPropagation: false,
//      });
//    });
//    this.storage = window.localStorage;
//    const innerPower = this.storage.getItem('inner-power');
//    if (!innerPower) {
//      this.query();
//    } else {
//      this.content = innerPower.content;
//      this.author = innerPower.author;
//    }
    },
    methods: {
//    update(payload) {
//      this.content = payload.content;
//      this.author = payload.author;
//    },
      query() {
//      const target = 'api/inner-power/random-load';
//      this.$http.request({
//        url: target,
//        method: 'get',
//      }).then((response) => {
//        this.storage.setItem('inner-power', response.data);
//        this.update(response.data);
//      }).catch(() => {
//      });
      },
    },
  };
</script>
